import request from '@/utils/request';
import { getParamsSuffix } from '@/utils/paramsUtils';

export async function listAllByPage(query) {
  const params = getParamsSuffix(query);
  return request(`/api/swservice/v1/sw/warehouse/listAllByPage?${params}`, {
    method: 'GET',
  });
}


export async function selectAllJournalsByUser(query) {
  const params = getParamsSuffix(query);
  return request(`/api/oaservice/v1/oa/selectAllJournalsByUser?${params}`, {
    method: 'GET',
  });
}

export async function listJournalsByPage(query) {
  const params = getParamsSuffix(query);
  return request(`/api/oaservice/v1/oa/listJournalsByPage?${params}`, {
    method: 'GET',
  });
}

export async function selectAllDevelopers(query) {
  const params = getParamsSuffix(query);
  return request(`/api/oaservice/v1/oa/selectAllDevelopers?${params}`, {
    method: 'GET',
  });
}

export async function queryAllProjects(query) {
  const params = getParamsSuffix(query);
  return request(`/api/oaservice/v1/oa/queryAllProjects?${params}`, {
    method: 'GET',
  });
}

export async function create(params) {
  return request('/api/oaservice/v1/oa/createProjectJournal', {
    method: 'POST',
    requestType: 'form',
    data: { ...params },
  });
}

export async function update(params) {
  return request('/api/swservice/v1/sw/warehouse/update', {
    method: 'POST',
    requestType: 'form',
    data: { ...params },
  });
}

export async function deleteJournalById(params) {
  return request('/api/oaservice/v1/oa/deleteJournalById', {
    method: 'POST',
    requestType: 'form',
    data: { ...params },
  });
}
